#@adminLayout() #define main()
<body class="gray-bg">
<div class="container-div">
    <div class="row">
        <div class="col-sm-12 search-collapse">
            <form id="data-form">
                <div class="select-list">
                    <ul>
                        <li>
                            名称：<input type="text" name="name"/>
                        </li>
                        <li>
                            <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i
                                    class="fa fa-search"></i>&nbsp;搜索</a>
                            <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i
                                    class="fa fa-refresh"></i>&nbsp;重置</a>
                        </li>
                    </ul>
                </div>
            </form>
        </div>

        <div class="btn-group-sm" id="toolbar" role="group">
            <a class="btn btn-success" onclick="$.operate.add()">
                <i class="fa fa-plus"></i> 新增
            </a>
            <a class="btn btn-primary single disabled" onclick="$.operate.edit()">
                <i class="fa fa-edit"></i> 修改
            </a>
            <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()">
                <i class="fa fa-remove"></i> 删除
            </a>
        </div>

        <div class="col-sm-12 select-table table-striped">
            <table id="bootstrap-table" data-mobile-responsive="true"></table>
        </div>
    </div>
</div>
<script type="text/javascript">
    var prefix = "#(ctx)/jwflow";
    $(function () {

        var options = {
            url: prefix + "/list",
            createUrl: prefix + "/edit",
            updateUrl: prefix + "/edit?id={id}",
            removeUrl: prefix + "/remove",
            uniqueId: "id",
            sortName: "name",
            sortOrder: "desc",
            modalName: "流程",
            columns: [{
                checkbox: true
            },
                {
                    title: '操作',
                    align: 'center',
                    formatter: function (value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-success btn-xs" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                        actions.push('<a class="btn btn-danger btn-xs" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a> ');
                        actions.push('<a class="btn btn-info btn-xs" href="javascript:void(0)" onclick="openDetail(\'' + row.id + '\')"><i class="fa fa-detail"></i>设计</a>');
                        return actions.join('');
                    }
                },
                {
                    field: 'code',
                    title: '代码'
                },
                {
                    field: 'name',
                    title: '名称'
                },
                {
                    field: 'desc',
                    title: '描述',
                },
                {
                    field: 'status',
                    title: '状态'
                },
                {
                    field: 'create_time',
                    title: '创建时间',
                    sortable: true
                },]
        };
        $.table.init(options);
    });

    function openDetail(id)
    {
        window.open(prefix+"/design?id="+id);
    }
</script>
</body>
#end